package com.mck.mapper;

import com.mck.entity.BackgroundColor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author mck
 */
@Mapper
public interface BackgroundColorMapper {
    /**
     * 获取背景颜色
     */
    @Select("select id, type, color, create_time, update_time from color")
    List<BackgroundColor> getBackgroundColor();

    /**
     * 更新背景颜色
     */
    @Update("update color set color = #{color}, update_time = #{updateTime} where type = #{type}")
    void updateBackgroundColor(BackgroundColor backgroundColor);
}
